package com.example.tiku2.presenter;

import com.example.tiku2.NetCallBack;
import com.example.tiku2.bean.ProjectBean;
import com.example.tiku2.model.NetModel;
import com.example.tiku2.view.NetView;

import java.util.List;

public class NetPresenter implements NetCallBack {
    private NetView netView;
    private NetModel netModel;

    public NetPresenter(NetView netView) {
        this.netView = netView;
        netModel = new NetModel();
    }

    //获取数据
    public void getData() {
        netModel.getData(this);
    }

    @Override
    public void onSuccess(List<ProjectBean.DataBean.DatasBean> datas) {
        netView.setData(datas);
    }

    @Override
    public void onFail(String str) {
        netView.showToast(str);
    }


}
